package tr.edu.yildiz.dap.appeditor.pages;

import java.util.List;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;

import tr.edu.yildiz.ce.dap.appagent.model.Component;
import tr.edu.yildiz.ce.dap.appagent.model.ComponentList;
import tr.edu.yildiz.dap.appeditor.pages.basic.IDAPFormPage;
import tr.edu.yildiz.dap.appeditor.pages.composites.ComponentsComposite;

public class MainPage extends IDAPFormPage {

	ComponentsComposite dependencyComposite;
	ComponentList componentList;
	
	public MainPage(FormEditor editor, String id, String title) {
		super(editor, id, title);
		this.componentList = componentList; 
	}


	@Override
	protected void createFormContent(IManagedForm managedForm) {
		FormToolkit toolkit = managedForm.getToolkit();
	    ScrolledForm form = managedForm.getForm();
	    form.setText("Components");
	    
	    form.getBody().setLayout(new GridLayout(1, true));

	    dependencyComposite = new ComponentsComposite(form.getBody(), this, SWT.NONE);
	    dependencyComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));  
	    
	    form.updateToolBar();

	}
	
	public ComponentsComposite getDependencyComposite() {
		return dependencyComposite;
	}
	
	public void setComponentList(ComponentList componentList) {
		this.componentList = componentList;
	}
	
	public ComponentList getComponentList() {
		return componentList;
	}
	
}
